#ifndef  _CC_TIMER_HANDLE_H_
#define  _CC_TIMER_HANDLE_H_

#include "timerlist.h"
#include "CCReactor.h"


class TimerOutEvent
{
public:
	virtual ~TimerOutEvent(){};
	virtual int ProcessOnTimerOut(int Timerid)=0;
};

class ICC_Timer_Handler: public CTimerObject
{
public:
		virtual void StartTimer(long interval, bool isloop=false)=0;
		virtual void StartTimer2(long ssecond, bool isloop=false)=0;
		virtual void StopTimer(void)=0;
};

class CCTimer: public ICC_Timer_Handler
{
	public:
	    CCTimer(){};
		virtual ~CCTimer();
		virtual void StartTimer(long millisecond, bool isloop=false);
		virtual void StartTimer2(long ssecond, bool isloop=false);
		virtual void StopTimer(void);
		void SetTimeEventObj(TimerOutEvent * obj, int id=0);
		virtual void TimerNotify(void);

	private:
		int _nId;
		TimerOutEvent* _TimeEvent;
		bool _isloop;
		long _interval;
};


#endif

